<template>
  <div class="image-gallery">
    <h2>图片展示</h2>
    <div class="image-grid">
      <div v-for="(image, index) in images" :key="index" class="image-item">
        <img :src="image.src" :alt="image.alt" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import aboutBg from '@/assets/img/about-bg.jpg'
import contactBg from '@/assets/img/contact-bg.jpg'
import homeBg from '@/assets/img/home-bg.jpg'
import postBg from '@/assets/img/post-bg.jpg'
import postSampleImage from '@/assets/img/post-sample-image.jpg'
import profile from '@/assets/img/photo.jpg'

const images = ref([
  { src: aboutBg, alt: '关于背景' },
  { src: contactBg, alt: '联系背景' },
  { src: homeBg, alt: '主页背景' },
  { src: postBg, alt: '文章背景' },
  { src: postSampleImage, alt: '示例图片' },
  { src: profile, alt: '个人资料' }
])
</script>

<style scoped>
.image-gallery {
  margin-top: 3rem;
  padding: 2rem;
  background-color: #f8f9fa;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.image-gallery h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  text-align: center;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.image-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-item:hover {
  transform: translateY(-5px);
}

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.image-item:hover img {
  transform: scale(1.05);
}
</style>